package rmaqlc31.basic;

import java.util.Scanner;

public class J03_Tax {

	public static void main(String[] args) {
		// 결혼 여부와 연봉에 따라 세금 계산
		// 결혼 여부 : 기혼, 미혼
		
		Scanner sc = null;
		String isMarried = "";	// 결혼 여부
		int married;			// 결혼 여부
		int salary;				// 연봉
		int tax = 0;				// 세금
		
		
		sc = new Scanner(System.in);
		System.out.println("결혼여부는? (미혼: 0, N / 기혼 : 1, Y)");
		//isMarried = sc.next();
		married = sc.nextInt();
		System.out.println("연봉은?");
		salary = sc.nextInt();
		
		
		// 표현식에서 문자열 비교는 == 연산자로
		// 할 수 없음, 문자열은 객체object형이기 때문
		/*if (ismarried = "미혼")
			System.out.println("미혼!");
		else if (ismarried = "기혼")
			System.out.println("기혼!");*/
		
		if(married == 0){				//미혼이라면
			if(salary<3000) tax = (int)(salary*0.1);
			else tax = (int)(salary*0.25);
			isMarried = "미혼";
			
		} else if(married == 1){		//기혼이라면
			if(salary<6000) tax = (int)(salary*0.15);
			else tax = (int)(salary*0.35);
			isMarried = "기혼";
		}
		
		System.out.println("결혼여부 : "+isMarried);
		System.out.println("연봉 : "+salary);
		System.out.println("세금 : "+tax);
		
		sc.close();
		
		
		/*Scanner sc = null;
		int pay;
		String marry;
		int tax1;
		int tax2;
		int tax3;
		int tax4;
		
		
		
		sc = new Scanner(System.in);
		
		System.out.println("결혼 여부를 입력하세요(O or X) : ");
	    marry = sc.next();
		System.out.println("연봉을 입력하세요 : ");
	    pay = sc.nextInt();
	    
	    tax1 = pay/100*10;
		tax2 = pay/100*25;
		tax3 = pay/100*15;
		tax4 = pay/100*35;
	    
	    
	    sc.close();
		
		if(marry.equals("X")&&pay<3000){System.out.println(tax1);}
		else if(marry.equals("X")&&pay>=3000){System.out.println(tax2);}
		else if(marry.equals("O")&&pay<6000){System.out.println(tax3);}
		else{System.out.println(tax4);}*/
		

	}

}
